@use '../../helpers/baseMixin.scss';

.vxe-form-design--widget-subtable-view {
  display: flex;
  flex-direction: row;
  max-width: 100%;
  border-radius: var(--vxe-ui-base-border-radius);
  overflow-y: hidden;
  overflow-x: auto;
}
.vxe-form-design--widget-subtable-view-box {
  border: 1px solid var(--vxe-ui-input-border-color);
  border-width: 1px 1px 1px 0;
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
}
.vxe-form-design--widget-subtable-view-left {
  position: sticky;
  left: 0;
  top: 0;
  display: flex;
  flex-shrink: 0;
  box-shadow: 8px 0px 10px -5px rgba(0,0,0,.12);
  border-radius: var(--vxe-ui-base-border-radius) 0 0 var(--vxe-ui-base-border-radius);
  z-index: 5;
}
.vxe-form-design--widget-subtable-view-right {
  flex-grow: 1;
}
.vxe-form-design--widget-subtable-col {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 54px;
  text-align: center;
  border-top: 1px solid var(--vxe-ui-input-border-color);
  border-right: 1px solid var(--vxe-ui-input-border-color);
  border-bottom: 1px solid var(--vxe-ui-input-border-color);
  background-color: var(--vxe-ui-layout-background-color);
  &:first-child {
    border-left: 1px solid var(--vxe-ui-input-border-color);
    border-radius: var(--vxe-ui-base-border-radius) 0 0 var(--vxe-ui-base-border-radius);
  }
  &::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
  }
}
.vxe-form-design--widget-subtable-head {
  flex-shrink: 0;
  height: 2.8em;
  line-height: 2.8em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 var(--vxe-ui-layout-padding-default);
  border-bottom: 1px solid var(--vxe-ui-input-border-color);
}
.vxe-form-design--widget-subtable-body {
  flex-grow: 1;
  padding: var(--vxe-ui-layout-padding-default);
}
.vxe-form-design--widget-subtable-head,
.vxe-form-design--widget-subtable-body {
  width: 100%;
}
.vxe-form-design--widget-subtable-body,
.vxe-form-design--widget-subtable-view-empty {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
}

.vxe-form-design--widget-subtable-view-wrapper {
  position: relative;
  display: flex;
  flex-direction: row;
  background-color: var(--vxe-ui-layout-background-color);
  border-radius: 0 var(--vxe-ui-base-border-radius) var(--vxe-ui-base-border-radius) 0;
  &::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 1px solid var(--vxe-ui-input-border-color);
    z-index: 1;
    pointer-events: none;
  }
}
.vxe-form-design--widget-subtable-view-list {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  & > .vxe-form-design--widget-subtable-view-item {
    border-right: 1px solid var(--vxe-ui-input-border-color);
    .vxe-form-design--preview-item-operate {
      top: 0.4em;
    }
  }
}
.vxe-form-design--widget-subtable-view-list-move {
  @include baseMixin.createAnimationTransition(transform, 0.35s);
}

.vxe-form-design--widget-subtable-view-item {
  position: relative;
  min-width: 200px;
  cursor: grabbing;
  &:hover {
    background-color: var(--vxe-ui-form-design-sub-widget-hover-background-color);
  }
  &.is--active {
    background: var(--vxe-ui-base-active-background-color);
    &::before {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      border: 1px dashed var(--vxe-ui-font-primary-color);
      pointer-events: none;
      z-index: 2;
    }
  }
}
.vxe-form-design--widget-subtable-view-item-box {
  height: 100%;
  &::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
  }
}

.vxe-form-design--widget-subtable-view-empty {
  flex-grow: 1;
  color: var(--vxe-ui-font-placeholder-color);
  padding: 0 var(--vxe-ui-layout-padding-threefold);
  min-height: 78px;
  min-width: 200px;
  cursor: default;
}

.vxe-form-design--widget-subtable-form-item {
  overflow: hidden;
}
.vxe-form-design--widget-subtable-view-item-wrapper {
  height: 100%;
  .vxe-form--item {
    &.is--vertical {
      padding: 0;
      .vxe-form--item-title {
        height: 2.8em;
        line-height: 2.8em;
        padding: 0 var(--vxe-ui-layout-padding-default);
      }
      .vxe-form--item-content {
        display: flex;
        flex-direction: row;
        align-items: center;
        padding: 0 var(--vxe-ui-layout-padding-default);
      }
    }
  }
  .vxe-form--item-title {
    border-bottom: 1px solid var(--vxe-ui-input-border-color);
  }
}

.vxe-form-design--preview-item {
  &.widget-subtable {
    padding: 0 var(--vxe-ui-layout-padding-double);
    &::after {
      display: none;
    }
  }
  .vxe-form-design--preview-item-view {
    .vxe-form-design--widget-subtable-form-item {
      & > .vxe-form--item-content {
        padding: 0;
      }
    }
    .vxe-form--group-content {
      align-items: unset;
    }
  }
}
